//
// Unihan Input Method
//
// Copyright © 2002-2007 Sun Wah Linux Ltd.
//
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
// USA
//
// $Id: pinyinpref_cb.c 757 2007-05-10 08:19:31Z roger $
//

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <gconf/gconf-client.h>
#include <unihan-gconf.h>
#include <glade/glade.h>

#include "pinyinpref_cb.h"



void
on_pinyin_freq_adjust_toggled           (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
{
	GConfClient *client = gconf_client_get_default();

	gconf_client_set_bool(client,
			UNIHAN_ROOT_KEY "/im-options/pinyin/freq",
			gtk_toggle_button_get_active(togglebutton),
			NULL);
}


void
on_pinyin_shuangpin_toggled            (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
{
	GConfClient *client = gconf_client_get_default();

	gconf_client_set_bool(client,
			UNIHAN_ROOT_KEY "/im-options/pinyin/shuangpin",
			gtk_toggle_button_get_active(togglebutton),
			NULL);
}


void
on_pinyin_illegibility_toggled          (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
{
	GConfClient *client = gconf_client_get_default();

	gconf_client_set_bool(client,
			UNIHAN_ROOT_KEY "/im-options/pinyin/illegibility",
			gtk_toggle_button_get_active(togglebutton),
			NULL);
}

void
on_pinyin_help_clicked                     (GtkButton       *button,
                                        gpointer         user_data)
{
	/*
	GError* err;
	
	if(!gnome_help_display ("ABC.xml", NULL, &err))
    	printf("call on_itabc_help_clicked failure:%s.\n", err->message);
    */
}

void
on_pinyin_close_clicked                     (GtkButton       *button,
                                        gpointer         user_data)
{
	GladeXML *xml = (GladeXML *)user_data;
	GtkWidget *w;
	
	w = glade_xml_get_widget(xml, "windowpinyin");
	g_object_unref(G_OBJECT(xml));
	gtk_widget_destroy(w);
}

// vi:ts=4:nowrap:cin:expandtab
